package com.duying.gh.manager;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.duying.gh.GhCommonManager;
import com.duying.gh.model.BasepJob;
import com.duying.gh.model.BasepNation;

public class BasepJobManager  extends GhCommonManager{
	
	
	public List getListSelect(){
		String hql = "from BasepJob x where x.auditing = 1 order by x.code asc";
		List list = this.baseDao.getByHQL(hql);
		List listSelect = new ArrayList();
		
		for(Object obj : list){
			int depth = 1;
			BasepJob c = (BasepJob)obj;
			Map map = new HashMap();
			map.put("pvalue",c.getCode() + "  " + c.getName());
			map.put("pkey",c.getId());
			listSelect.add(map);
		}
		return listSelect;
	}

	
	public List getList(){
		String hql = "from BasepJob x where x.auditing = 1 order by x.id asc";
		List list = this.baseDao.getByHQL(hql);
		return list;
	}
	
	
	public List getList4Import(){
		
		String hql = "from BasepJob x where x.auditing = 1 order by x.id asc";
		List list = this.baseDao.getByHQL(hql);
		List listImport = new ArrayList();
		
		for(Object obj : list){
			BasepJob c = (BasepJob)obj;
			Map map = new HashMap();
			map.put(c.getCode(),c.getId());
			listImport.add(map);
		}
		return listImport;
	}
	
	

	public Integer getId(BasepJob bobj){
		if(bobj == null){
			return 9;
		}else{
			return bobj.getId();
		}
	}
}
